﻿#include "qpixitem.h"

QPixItem::QPixItem(const QString &fileName,QGraphicsScene *scene)
{
    pix.load(fileName);
    scene->addItem(this);

}
QRectF QPixItem::boundingRect() const
{
    return QRectF(-pix.width()/2,-pix.height(),pix.width(),pix.height());
}

void QPixItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
     painter->drawPixmap(-pix.width()/2,-pix.height(),pix);
}

